﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;

namespace ifunction.BaiduBCS.SDK
{
    /// <summary>
    /// Class StorageObjectSummary.
    /// </summary>
    [DataContract]
    public class StorageObjectSummary : StorageObjectIdentity
    {
        /// <summary>
        /// Gets or sets the version key.
        /// </summary>
        /// <value>The version key.</value>
        [DataMember(Name = "version_key")]
        public string VersionKey
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the requester.
        /// </summary>
        /// <value>The requester.</value>
        [DataMember(Name = "requester")]
        public string Requester
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the requester ip address.
        /// </summary>
        /// <value>The requester ip address.</value>
        [DataMember(Name = "request_ip")]
        public string RequesterIpAddress
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the size.
        /// </summary>
        /// <value>The size.</value>
        [DataMember(Name = "size")]
        public long Size
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the parent directory.
        /// </summary>
        /// <value>The parent directory.</value>
        [DataMember(Name = "parent_dir")]
        public string ParentDirectory
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is directory.
        /// </summary>
        /// <value><c>true</c> if this instance is directory; otherwise, <c>false</c>.</value>
        [DataMember(Name = "is_dir")]
        [JsonConverter(typeof(BooleanConverter))]
        public bool IsDirectory
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the last updated stamp.
        /// </summary>
        /// <value>The last updated stamp.</value>
        [DataMember(Name = "mdatetime")]
        [JsonConverter(typeof(JavaScriptDateTimeConverter))]
        public DateTime? LastUpdatedStamp
        {
            get;
            set;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="StorageObjectSummary"/> class.
        /// </summary>
        public StorageObjectSummary()
            : base()
        {

        }
    }
}
